# Contributor: omni <omni+alpine@hack.org>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=ugm
pkgver=1.4.0
pkgrel=2
pkgdesc="A terminal based UNIX user and group browser"
url="https://github.com/ariasmn/ugm"
license="MIT"
arch="all"
makedepends="go"
options="!check" # no test files
source="$pkgname-$pkgver.tar.gz::https://github.com/ariasmn/ugm/archive/refs/tags/v$pkgver.tar.gz"

export GOFLAGS="$GOFLAGS -trimpath -mod=readonly -modcacherw"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build \
		-ldflags="-linkmode=external -extldflags \"$LDFLAGS\"" \
		-v .
}

package() {
	install -Dm0755 "$pkgname" -t "$pkgdir"/usr/bin
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
8adb1f2ba331c378e9002940e49b3c48f6cf5b01fe99076c394c20f388c8eef787de3367e1e6266e78211e91eb2af9bf76ce1bf3394669f4c4a2c5190ba035dc  ugm-1.4.0.tar.gz
"
